local hx__bachijing = fk.CreateSkill{
    name = "hx__bachijing",

    tags = {Skill.Switch},
}

hx__bachijing:addEffect(fk.SkillEffect,{
    can_trigger = function (self, event, target, player, data)
        return player:hasSkill(hx__bachijing.name) and target and target == player and data.skill and data.skill:isPlayerSkill(player) and player:getSwitchSkillState(hx__bachijing.name) == fk.SwitchYang
        and data.skill:getSkeleton().name ~= hx__bachijing.name
    end,
    on_cost = function (self, event, target, player, data)
        return player.room:askToSkillInvoke(player,{skill_name = hx__bachijing.name,prompt = "#hx__bachijing__evoke"})
    end,
    on_use = function (self, event, target, player, data)
        local room = player.room
        room:setPlayerMark(player,"@hx__guangsuti_combo",0)
        local to = room:askToChoosePlayers(player,{ min_num = 1, max_num = 1, targets = room:getOtherPlayers(player), skill_name = "hx__guangsuti", cancelable = false, prompt = "#hx__guangsuti__evoke", })
        room:addTableMarkIfNeed(player,"hx__guangsuti__tars",to[1].id)
        room:moveSeatTo(player,to[1]:getNextAlive().seat,false)
        room:useCard({
            from = player,
            tos = to,
            card = Fk:cloneCard("thunder__slash"),
            disresponsiveList = room.alive_players,
        })
    end,
})

hx__bachijing:addEffect(fk.EnterDying,{
    can_trigger = function (self, event, target, player, data)
        return player:hasSkill(hx__bachijing.name) and target and player:getSwitchSkillState(hx__bachijing.name) == fk.SwitchYin
    end,
    on_cost = Util.TrueFunc,
    on_use = function (self, event, target, player, data)
        local room = player.room
        player:setSkillUseHistory("hx__guangsuti",0,Player.HistoryGame)
        player:setSkillUseHistory("hx__guangjuexing",0,Player.HistoryGame)
        room:setPlayerMark(player,"@hx__guangsuti_combo",0)
    end,
})

return hx__bachijing